<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Main</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Main' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="index.html">inform7</a></li><li><a href="index.html#1">Chapter 1: Delegation</a></li><li><b>Main</b></li></ul></div>
<p class="purpose">The command-line interface for the Inform 7 compiler tool.</p>

<ul class="toc"><li><a href="1-mn.html#SP4">&#167;4. Command line processing</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>On some platforms the core Inform compiler is a separate command-line tool,
so that execution should begin with <span class="extract"><span class="extract-syntax">main()</span></span>, as in all C programs. But some
Inform UI applications need to compile it into the body of a larger program:
those should define the symbol <span class="extract"><span class="extract-syntax">SUPPRESS_MAIN</span></span> and call <span class="extract"><span class="extract-syntax">Main::deputy</span></span>
when they want I7 to run.
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">PROGRAM_NAME</span><span class="plain-syntax"> </span><span class="string-syntax">"inform7"</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">#</span><span class="identifier-syntax">ifndef</span><span class="plain-syntax"> </span><span class="constant-syntax">SUPPRESS_MAIN</span>
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">main</span><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">argc</span><span class="plain-syntax">, </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">argv</span><span class="plain-syntax">[]) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="1-mn.html#SP2" class="function-link"><span class="function-syntax">Main::deputy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">argc</span><span class="plain-syntax">, </span><span class="identifier-syntax">argv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
<span class="plain-syntax">#</span><span class="identifier-syntax">endif</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>And so the <a href="1-mn.html#SP2" class="internal">Main::deputy</a> function now has the opportunity to be head
honcho, and for the first fifteen years of Inform 7, it was exactly that. In
2020, though, it was deposed in a boardroom coup by a new CEO, the <a href="../supervisor-module/index.html" class="internal">supervisor</a>
module. High-level decisions on what to compile, where to put the result, and
so on, are all now taken by <a href="../supervisor-module/index.html" class="internal">supervisor</a>. Even the command line is very largely
read and dealt with by <a href="../supervisor-module/index.html" class="internal">supervisor</a> and not by this section after all. The
upshot is that <a href="1-mn.html#SP2" class="internal">Main::deputy</a> is now a manager in name only, reduced to the
equivalent of unlocking the doors and turning the lights on in the morning.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">silence_is_golden</span><span class="plain-syntax"> = </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">index_explicitly_set</span><span class="plain-syntax"> = </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">problems_explicitly_set</span><span class="plain-syntax"> = </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">pathname</span><span class="plain-syntax"> *</span><span class="identifier-syntax">diagnostics_path</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">log_to_project</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Main::deputy</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Main::deputy</span></span>:<br/><a href="1-mn.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">argc</span><span class="plain-syntax">, </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">argv</span><span class="plain-syntax">[]) {</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="1-mn.html#SP2_1" class="named-paragraph-link"><span class="named-paragraph">Start up</span><span class="named-paragraph-number">2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">proceed</span><span class="plain-syntax"> = </span><a href="1-mn.html#SP4" class="function-link"><span class="function-syntax">Main::read_command_line</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">argc</span><span class="plain-syntax">, </span><span class="identifier-syntax">argv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-pth.html#SP3" class="function-link"><span class="function-syntax">Pathnames::set_path_to_LP_resources</span></a><span class="plain-syntax">(</span><a href="../supervisor-module/2-nst.html#SP5" class="function-link"><span class="function-syntax">Nests::get_location</span></a><span class="plain-syntax">(</span><a href="../supervisor-module/1-ic.html#SP16" class="function-link"><span class="function-syntax">Supervisor::internal_if_set</span></a><span class="plain-syntax">()));</span>
<span class="plain-syntax">    </span><a href="../core-module/3-pc.html#SP2" class="function-link"><span class="function-syntax">PluginCalls::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">proceed</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">silence_is_golden</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="../core-module/1-pp2.html#SP1" class="function-link"><span class="function-syntax">ProgressBar::enable_or_disable</span></a><span class="plain-syntax">(</span><span class="constant-syntax">FALSE</span><span class="plain-syntax">); </span><span class="comment-syntax"> disable</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">PRINT</span><span class="plain-syntax">(</span><span class="string-syntax">"Inform 7 v[[Version Number]] has started.\n"</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">, </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">inform_project</span><span class="plain-syntax"> *</span><span class="identifier-syntax">proj</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="1-mn.html#SP2_2" class="named-paragraph-link"><span class="named-paragraph">Find the project identified for us by Inbuild</span><span class="named-paragraph-number">2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="1-mn.html#SP2_3" class="named-paragraph-link"><span class="named-paragraph">Open the debugging log and the problems report</span><span class="named-paragraph-number">2.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="1-mn.html#SP2_4" class="named-paragraph-link"><span class="named-paragraph">Build the project</span><span class="named-paragraph-number">2.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="1-mn.html#SP2_5" class="named-paragraph-link"><span class="named-paragraph">Post mortem logging</span><span class="named-paragraph-number">2.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">proceed</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="1-mn.html#SP2_6" class="named-paragraph-link"><span class="named-paragraph">Shutdown and rennab</span><span class="named-paragraph-number">2.6</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">problem_count</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><a href="../problems-module/2-pl0.html#SP1" class="function-link"><span class="function-syntax">ProblemSigils::exit</span></a><span class="plain-syntax">(1);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="1-mn.html#SP2_7" class="named-paragraph-link"><span class="named-paragraph">Shut down the modules</span><span class="named-paragraph-number">2.7</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2_1" class="paragraph-anchor"></a><b>&#167;2.1. </b>We need to make sure that internal errors, though they should never happen,
are reported as problem messages (fed to our HTML problems report) rather than
simply causing an abrupt exit with only a plain text error written to <span class="extract"><span class="extract-syntax">stderr</span></span>.
See the <span class="extract"><span class="extract-syntax">problems</span></span> module for more.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Start up</span><span class="named-paragraph-number">2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="1-mn.html#SP2_1_1" class="named-paragraph-link"><span class="named-paragraph">Start up the modules</span><span class="named-paragraph-number">2.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="../foundation/3-em.html#SP1" class="function-link"><span class="function-syntax">Errors::set_internal_handler</span></a><span class="plain-syntax">(&amp;</span><a href="../problems-module/2-pl3.html#SP4" class="function-link"><span class="function-syntax">StandardProblems::internal_error_fn</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../core-module/1-wtc.html#SP1" class="function-link"><span class="function-syntax">Task::start_timers</span></a><span class="plain-syntax">();</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="1-mn.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_1_1" class="paragraph-anchor"></a><b>&#167;2.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Start up the modules</span><span class="named-paragraph-number">2.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="../foundation/1-fm.html#SP8" class="function-link"><span class="function-syntax">Foundation::start</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">argc</span><span class="plain-syntax">, </span><span class="identifier-syntax">argv</span><span class="plain-syntax">); </span><span class="comment-syntax"> must be started first</span>
<span class="plain-syntax">    </span><a href="1-lm.html#SP3" class="function-link"><span class="function-syntax">LiterateModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../words-module/1-wm2.html#SP3" class="function-link"><span class="function-syntax">WordsModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../inflections-module/1-im.html#SP3" class="function-link"><span class="function-syntax">InflectionsModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../syntax-module/1-sm.html#SP3" class="function-link"><span class="function-syntax">SyntaxModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../lexicon-module/1-lm2.html#SP3" class="function-link"><span class="function-syntax">LexiconModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../linguistics-module/1-lm3.html#SP3" class="function-link"><span class="function-syntax">LinguisticsModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../kinds-module/1-km.html#SP3" class="function-link"><span class="function-syntax">KindsModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../calculus-module/1-cm.html#SP3" class="function-link"><span class="function-syntax">CalculusModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../problems-module/1-pm.html#SP3" class="function-link"><span class="function-syntax">ProblemsModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../core-module/1-cm2.html#SP2" class="function-link"><span class="function-syntax">CoreModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../assertions-module/1-am2.html#SP2" class="function-link"><span class="function-syntax">AssertionsModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../knowledge-module/1-km2.html#SP3" class="function-link"><span class="function-syntax">KnowledgeModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../imperative-module/1-im2.html#SP2" class="function-link"><span class="function-syntax">ImperativeModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../runtime-module/1-rm.html#SP2" class="function-link"><span class="function-syntax">RuntimeModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../values-module/1-vm.html#SP2" class="function-link"><span class="function-syntax">ValuesModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../if-module/1-im3.html#SP2" class="function-link"><span class="function-syntax">IFModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../multimedia-module/1-mm.html#SP2" class="function-link"><span class="function-syntax">MultimediaModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../html-module/1-hm.html#SP2" class="function-link"><span class="function-syntax">HTMLModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../index-module/1-im4.html#SP2" class="function-link"><span class="function-syntax">IndexModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../arch-module/1-am.html#SP3" class="function-link"><span class="function-syntax">ArchModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../bytecode-module/1-bm.html#SP3" class="function-link"><span class="function-syntax">BytecodeModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../building-module/1-bm2.html#SP3" class="function-link"><span class="function-syntax">BuildingModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../pipeline-module/1-pm2.html#SP3" class="function-link"><span class="function-syntax">PipelineModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../final-module/1-fm2.html#SP3" class="function-link"><span class="function-syntax">FinalModule::start</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../supervisor-module/1-sm2.html#SP3" class="function-link"><span class="function-syntax">SupervisorModule::start</span></a><span class="plain-syntax">();</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="1-mn.html#SP2_1">&#167;2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_2" class="paragraph-anchor"></a><b>&#167;2.2. </b>The <a href="../supervisor-module/index.html" class="internal">supervisor</a> would happily send us instructions to compile multiple
projects, but we can only accept one; and in fact the <a href="index.html" class="internal">inform7</a> command line
isn't set up to allow more, so this error is not easy to generate.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Find the project identified for us by Inbuild</span><span class="named-paragraph-number">2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">inform_project</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="reserved-syntax">inform_project</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">proj</span><span class="plain-syntax">) </span><a href="../problems-module/2-pl2.html#SP15" class="function-link"><span class="function-syntax">Problems::fatal</span></a><span class="plain-syntax">(</span><span class="string-syntax">"Multiple projects given on the command line"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">proj</span><span class="plain-syntax"> = </span><span class="identifier-syntax">P</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">proj</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">proj</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">stand_alone</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">index_explicitly_set</span><span class="plain-syntax"> == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="../core-module/1-wtc.html#SP21" class="function-link"><span class="function-syntax">Task::disable_or_enable_index</span></a><span class="plain-syntax">(</span><span class="constant-syntax">TRUE</span><span class="plain-syntax">); </span><span class="comment-syntax"> disable it</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">problems_explicitly_set</span><span class="plain-syntax"> == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="../core-module/1-wtc.html#SP21" class="function-link"><span class="function-syntax">Task::disable_or_enable_problems</span></a><span class="plain-syntax">(</span><span class="constant-syntax">TRUE</span><span class="plain-syntax">); </span><span class="comment-syntax"> disable it</span>
<span class="plain-syntax">        </span><a href="../core-module/1-pp2.html#SP1" class="function-link"><span class="function-syntax">ProgressBar::enable_or_disable</span></a><span class="plain-syntax">(</span><span class="constant-syntax">FALSE</span><span class="plain-syntax">); </span><span class="comment-syntax"> disable it</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/2-dl.html#SP5" class="function-link"><span class="function-syntax">Log::get_debug_log_filename</span></a><span class="plain-syntax">() == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="../foundation/2-dl.html#SP9" class="function-link"><span class="function-syntax">Log::set_aspect_from_command_line</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"nothing"</span><span class="plain-syntax">, </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">silence_is_golden</span><span class="plain-syntax">) </span><a href="../core-module/1-wtc.html#SP21" class="function-link"><span class="function-syntax">Task::disable_or_enable_problems</span></a><span class="plain-syntax">(</span><span class="constant-syntax">TRUE</span><span class="plain-syntax">); </span><span class="comment-syntax"> disable it</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="1-mn.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_3" class="paragraph-anchor"></a><b>&#167;2.3. </b><a href="../supervisor-module/index.html" class="internal">supervisor</a> supplies us with a folder in which to write the debugging log
and the Problems report (the HTML version of our error messages or success
message, which is displayed in the Inform app when a compilation has finished).
This folder will usually be the <span class="extract"><span class="extract-syntax">Build</span></span> subfolder of the project folder,
but we won't assume that. Remember, <a href="../supervisor-module/index.html" class="internal">supervisor</a> knows best.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Open the debugging log and the problems report</span><span class="named-paragraph-number">2.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (((</span><span class="identifier-syntax">proj</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">proj</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">stand_alone</span><span class="plain-syntax"> == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">)) || (</span><a href="../foundation/2-dl.html#SP5" class="function-link"><span class="function-syntax">Log::get_debug_log_filename</span></a><span class="plain-syntax">())) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">proj</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">pathname</span><span class="plain-syntax"> *</span><span class="identifier-syntax">build_folder</span><span class="plain-syntax"> = </span><a href="../supervisor-module/5-ps2.html#SP7" class="function-link"><span class="function-syntax">Projects::build_path</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">proj</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/3-pth.html#SP9" class="function-link"><span class="function-syntax">Pathnames::create_in_file_system</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">build_folder</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><a href="../problems-module/2-pl2.html#SP15" class="function-link"><span class="function-syntax">Problems::fatal</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"Unable to create Build folder for project: is it read-only?"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">DF</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">build_folder</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Debug log.txt"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="../foundation/2-dl.html#SP5" class="function-link"><span class="function-syntax">Log::set_debug_log_filename</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">DF</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><a href="../foundation/2-dl.html#SP5" class="function-link"><span class="function-syntax">Log::open</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"inform7 was called as:"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">argc</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">" %s"</span><span class="plain-syntax">, </span><span class="identifier-syntax">argv</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">]);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="../foundation/3-cla.html#SP10" class="function-link"><span class="function-syntax">CommandLine::play_back_log</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP8" class="function-link"><span class="function-syntax">Str::len</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">log_to_project</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/2-dl.html#SP9" class="function-link"><span class="function-syntax">Log::set_aspect_from_command_line</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">log_to_project</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">) == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><a href="../problems-module/2-pl2.html#SP15" class="function-link"><span class="function-syntax">Problems::fatal</span></a><span class="plain-syntax">(</span><span class="string-syntax">"Unknown -log-to-project setting"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">proj</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../core-module/1-wtc.html#SP21" class="function-link"><span class="function-syntax">Task::problems_enabled</span></a><span class="plain-syntax">()) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">pathname</span><span class="plain-syntax"> *</span><span class="identifier-syntax">build_folder</span><span class="plain-syntax"> = </span><a href="../supervisor-module/5-ps2.html#SP7" class="function-link"><span class="function-syntax">Projects::build_path</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">proj</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">PF</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">build_folder</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Problems.html"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="../problems-module/2-pl3.html#SP19" class="function-link"><span class="function-syntax">StandardProblems::start_problems_report</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">PF</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><a href="../problems-module/2-pl3.html#SP19" class="function-link"><span class="function-syntax">StandardProblems::start_problems_report</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>

<span class="plain-syntax">        </span><a href="../foundation/5-htm.html#SP18" class="function-link"><span class="function-syntax">HTML::set_link_abbreviation_path</span></a><span class="plain-syntax">(</span><a href="../supervisor-module/5-ps2.html#SP7" class="function-link"><span class="function-syntax">Projects::path</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">proj</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="1-mn.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_4" class="paragraph-anchor"></a><b>&#167;2.4. </b>The compiler is now ready for use. We ask <a href="../supervisor-module/index.html" class="internal">supervisor</a> to go ahead and
build that project: it will incrementally build some of the resources needed,
if any of them are, and then call upon <a href="../core-module/index.html" class="internal">core</a> to perform the actual
compilation.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Build the project</span><span class="named-paragraph-number">2.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="../supervisor-module/1-ic.html#SP12" class="function-link"><span class="function-syntax">Supervisor::go_operational</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">proj</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><a href="../supervisor-module/3-is2.html#SP3" class="function-link"><span class="function-syntax">InterSkill::echo_kit_building</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><a href="../supervisor-module/2-cps.html#SP12" class="function-link"><span class="function-syntax">Copies::build</span></a><span class="plain-syntax">(</span><span class="constant-syntax">STDOUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">proj</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">as_copy</span><span class="plain-syntax">, </span><a href="../supervisor-module/3-bm.html#SP3" class="function-link"><span class="function-syntax">BuildMethodology::stay_in_current_process</span></a><span class="plain-syntax">());</span>
<span class="plain-syntax">        </span><a href="../core-module/1-wtc.html#SP1" class="function-link"><span class="function-syntax">Task::stop_timers</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="1-mn.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_5" class="paragraph-anchor"></a><b>&#167;2.5. </b>Diagnostics files fall into the category of "be careful what you wish for";
they can be rather lengthy.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Post mortem logging</span><span class="named-paragraph-number">2.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">problem_count</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">diagnostics_path</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::write_diagnostics</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I</span><span class="string-syntax">"timings-diagnostics.txt"</span><span class="plain-syntax">, &amp;</span><a href="../core-module/1-wtc.html#SP1" class="function-link"><span class="function-syntax">Task::log_stopwatch</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::write_diagnostics</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I</span><span class="string-syntax">"memory-diagnostics.txt"</span><span class="plain-syntax">, &amp;</span><a href="../foundation/2-mmr.html#SP27" class="function-link"><span class="function-syntax">Memory::log_statistics</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::write_diagnostics</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I</span><span class="string-syntax">"syntax-diagnostics.txt"</span><span class="plain-syntax">, &amp;</span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::log_task_syntax_tree</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::write_diagnostics</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I</span><span class="string-syntax">"syntax-summary.txt"</span><span class="plain-syntax">, &amp;</span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::log_task_syntax_summary</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::write_diagnostics</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I</span><span class="string-syntax">"preform-diagnostics.txt"</span><span class="plain-syntax">, &amp;</span><a href="../words-module/4-ins.html#SP8" class="function-link"><span class="function-syntax">Instrumentation::log</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::write_diagnostics</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I</span><span class="string-syntax">"preform-summary.txt"</span><span class="plain-syntax">, &amp;</span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::log_preform_summary</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::write_diagnostics</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I</span><span class="string-syntax">"documentation-diagnostics.txt"</span><span class="plain-syntax">, &amp;</span><a href="../html-module/2-dr.html#SP9" class="function-link"><span class="function-syntax">DocReferences::log_statistics</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::write_diagnostics</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I</span><span class="string-syntax">"verbs-diagnostics.txt"</span><span class="plain-syntax">, &amp;</span><a href="../linguistics-module/3-vu.html#SP2" class="function-link"><span class="function-syntax">VerbUsages::log_all</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::write_diagnostics</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I</span><span class="string-syntax">"excerpts-diagnostics.txt"</span><span class="plain-syntax">, &amp;</span><a href="../lexicon-module/2-pe.html#SP9" class="function-link"><span class="function-syntax">FromLexicon::statistics</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-mn.html#SP3" class="function-link"><span class="function-syntax">Main::write_diagnostics</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I</span><span class="string-syntax">"stock-diagnostics.txt"</span><span class="plain-syntax">, &amp;</span><a href="../linguistics-module/1-sc.html#SP7" class="function-link"><span class="function-syntax">Stock::log_all</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="1-mn.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_6" class="paragraph-anchor"></a><b>&#167;2.6. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Shutdown and rennab</span><span class="named-paragraph-number">2.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">silence_is_golden</span><span class="plain-syntax"> == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><a href="../problems-module/2-pl1.html#SP7" class="function-link"><span class="function-syntax">ProblemBuffer::write_reports</span></a><span class="plain-syntax">(</span><span class="constant-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"Total of %d files written as streams.\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">total_file_writes</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="../foundation/2-wal.html#SP3" class="function-link"><span class="function-syntax">Writers::log_escape_usage</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="constant-syntax">STDOUT</span><span class="plain-syntax">, </span><span class="string-syntax">"Inform 7 has finished.\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="1-mn.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_7" class="paragraph-anchor"></a><b>&#167;2.7. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Shut down the modules</span><span class="named-paragraph-number">2.7</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="../words-module/1-wm2.html#SP3" class="function-link"><span class="function-syntax">WordsModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../inflections-module/1-im.html#SP3" class="function-link"><span class="function-syntax">InflectionsModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../syntax-module/1-sm.html#SP3" class="function-link"><span class="function-syntax">SyntaxModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../lexicon-module/1-lm2.html#SP3" class="function-link"><span class="function-syntax">LexiconModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../linguistics-module/1-lm3.html#SP3" class="function-link"><span class="function-syntax">LinguisticsModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../kinds-module/1-km.html#SP3" class="function-link"><span class="function-syntax">KindsModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../calculus-module/1-cm.html#SP3" class="function-link"><span class="function-syntax">CalculusModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../problems-module/1-pm.html#SP3" class="function-link"><span class="function-syntax">ProblemsModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../multimedia-module/1-mm.html#SP2" class="function-link"><span class="function-syntax">MultimediaModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../core-module/1-cm2.html#SP2" class="function-link"><span class="function-syntax">CoreModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../assertions-module/1-am2.html#SP2" class="function-link"><span class="function-syntax">AssertionsModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../knowledge-module/1-km2.html#SP3" class="function-link"><span class="function-syntax">KnowledgeModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../imperative-module/1-im2.html#SP2" class="function-link"><span class="function-syntax">ImperativeModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../runtime-module/1-rm.html#SP2" class="function-link"><span class="function-syntax">RuntimeModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../values-module/1-vm.html#SP2" class="function-link"><span class="function-syntax">ValuesModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../if-module/1-im3.html#SP3" class="function-link"><span class="function-syntax">IFModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../index-module/1-im4.html#SP2" class="function-link"><span class="function-syntax">IndexModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../html-module/1-hm.html#SP2" class="function-link"><span class="function-syntax">HTMLModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../bytecode-module/1-bm.html#SP3" class="function-link"><span class="function-syntax">BytecodeModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../arch-module/1-am.html#SP3" class="function-link"><span class="function-syntax">ArchModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../building-module/1-bm2.html#SP5" class="function-link"><span class="function-syntax">BuildingModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../pipeline-module/1-pm2.html#SP3" class="function-link"><span class="function-syntax">PipelineModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../final-module/1-fm2.html#SP3" class="function-link"><span class="function-syntax">FinalModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../supervisor-module/1-sm2.html#SP3" class="function-link"><span class="function-syntax">SupervisorModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="1-lm.html#SP3" class="function-link"><span class="function-syntax">LiterateModule::end</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="../foundation/1-fm.html#SP9" class="function-link"><span class="function-syntax">Foundation::end</span></a><span class="plain-syntax">(); </span><span class="comment-syntax"> must be ended last</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="1-mn.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Main::write_diagnostics</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">Main::write_diagnostics</span></span>:<br/><a href="1-mn.html#SP2_5">&#167;2.5</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">leafname</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">write_fn</span><span class="plain-syntax">)(</span><span class="reserved-syntax">void</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">F</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">diagnostics_path</span><span class="plain-syntax">, </span><span class="identifier-syntax">leafname</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> </span><span class="identifier-syntax">diagnostics_file</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">STREAM_OPEN_TO_FILE</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">diagnostics_file</span><span class="plain-syntax">, </span><span class="identifier-syntax">F</span><span class="plain-syntax">, </span><span class="constant-syntax">ISO_ENC</span><span class="plain-syntax">) == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"can't open diagnostics file"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">save_DL</span><span class="plain-syntax"> = </span><span class="identifier-syntax">DL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DL</span><span class="plain-syntax"> = &amp;</span><span class="identifier-syntax">diagnostics_file</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="../foundation/2-str.html#SP20" class="function-link"><span class="function-syntax">Streams::enable_debugging</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">DL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    (*</span><span class="identifier-syntax">write_fn</span><span class="plain-syntax">)();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DL</span><span class="plain-syntax"> = </span><span class="identifier-syntax">save_DL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">STREAM_CLOSE</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">diagnostics_file</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Main::log_task_syntax_tree</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">Main::log_task_syntax_tree</span></span>:<br/><a href="1-mn.html#SP2_5">&#167;2.5</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="../syntax-module/2-pn.html#SP16" class="function-link"><span class="function-syntax">Node::log_tree</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">DL</span><span class="plain-syntax">, </span><a href="../core-module/1-wtc.html#SP7" class="function-link"><span class="function-syntax">Task::syntax_tree</span></a><span class="plain-syntax">()-&gt;</span><span class="element-syntax">root_node</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Main::log_preform_summary</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">Main::log_preform_summary</span></span>:<br/><a href="1-mn.html#SP2_5">&#167;2.5</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="../words-module/4-ins.html#SP8" class="function-link"><span class="function-syntax">Instrumentation::log_nt</span></a><span class="plain-syntax">(</span><span class="function-syntax">&lt;s-literal&gt;</span><span class="plain-syntax">, </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Main::log_task_syntax_summary</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">Main::log_task_syntax_summary</span></span>:<br/><a href="1-mn.html#SP2_5">&#167;2.5</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="../syntax-module/2-pn.html#SP16" class="function-link"><span class="function-syntax">Node::summarise_tree</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">DL</span><span class="plain-syntax">, </span><a href="../core-module/1-wtc.html#SP7" class="function-link"><span class="function-syntax">Task::syntax_tree</span></a><span class="plain-syntax">()-&gt;</span><span class="element-syntax">root_node</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. Command line processing.</b>The bulk of the command-line options are both registered and processed by
<a href="../supervisor-module/index.html" class="internal">supervisor</a> rather than here: in particular, every switch ever used by the
Inform UI apps is really a command to <a href="../supervisor-module/index.html" class="internal">supervisor</a> not to <span class="extract"><span class="extract-syntax">inform7</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Main::read_command_line</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">Main::read_command_line</span></span>:<br/><a href="1-mn.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">argc</span><span class="plain-syntax">, </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">argv</span><span class="plain-syntax">[]) {</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP2" class="function-link"><span class="function-syntax">CommandLine::declare_heading</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"inform7: a compiler from source text to Inter code\n\n"</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"Usage: inform7 [OPTIONS]\n"</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="1-mn.html#SP4_1" class="named-paragraph-link"><span class="named-paragraph">Register command-line arguments</span><span class="named-paragraph-number">4.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="../supervisor-module/1-ic.html#SP6" class="function-link"><span class="function-syntax">Supervisor::declare_options</span></a><span class="plain-syntax">();</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">sub</span><span class="plain-syntax"> = </span><a href="../foundation/3-cla.html#SP8" class="function-link"><span class="function-syntax">CommandLine::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">argc</span><span class="plain-syntax">, </span><span class="identifier-syntax">argv</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, &amp;</span><a href="1-mn.html#SP5" class="function-link"><span class="function-syntax">Main::switch</span></a><span class="plain-syntax">, &amp;</span><a href="1-mn.html#SP5" class="function-link"><span class="function-syntax">Main::bareword</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">sub</span><span class="plain-syntax"> != </span><span class="constant-syntax">NO_CLSUB</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">shared_internal_nest</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">pathname</span><span class="plain-syntax"> *</span><span class="identifier-syntax">path_to_inform</span><span class="plain-syntax"> = </span><a href="../foundation/3-pth.html#SP3" class="function-link"><span class="function-syntax">Pathnames::installation_path</span></a><span class="plain-syntax">(</span><span class="string-syntax">"INFORM7_PATH"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"inform7"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="../supervisor-module/1-ic.html#SP14" class="function-link"><span class="function-syntax">Supervisor::add_nest</span></a><span class="plain-syntax">(</span><a href="../foundation/3-pth.html#SP4" class="function-link"><span class="function-syntax">Pathnames::down</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">path_to_inform</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Internal"</span><span class="plain-syntax">), </span><span class="constant-syntax">INTERNAL_NEST_TAG</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><a href="../supervisor-module/1-ic.html#SP10" class="function-link"><span class="function-syntax">Supervisor::optioneering_complete</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">, &amp;</span><a href="../core-module/1-cp2.html#SP1" class="function-link"><span class="function-syntax">CorePreform::load</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> (</span><span class="identifier-syntax">sub</span><span class="plain-syntax"> != </span><span class="constant-syntax">NO_CLSUB</span><span class="plain-syntax">)?</span><span class="identifier-syntax">TRUE:FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4_1" class="paragraph-anchor"></a><b>&#167;4.1. </b>What remains here are just some eldritch options for testing the <span class="extract"><span class="extract-syntax">inform7</span></span>
compiler via Delia scripts in <span class="extract"><span class="extract-syntax">intest</span></span>.
</p>

<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">INFORM_TESTING_CLSG</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">CRASHALL_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">DIAGNOSTICS_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">INDEX_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">PROBLEMS_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">CENSUS_UPDATE_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">PROGRESS_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">REQUIRE_PROBLEM_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">SIGILS_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">TEST_OUTPUT_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">SILENCE_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">CHECK_RESOURCES_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">INBUILD_VERBOSE_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">INBUILD_VERBOSITY_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">LOG_TO_PROJECT_CLSW</span>
</pre>
<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Register command-line arguments</span><span class="named-paragraph-number">4.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP5" class="function-link"><span class="function-syntax">CommandLine::begin_group</span></a><span class="plain-syntax">(</span><span class="constant-syntax">INFORM_TESTING_CLSG</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"for testing and debugging inform7"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP6" class="function-link"><span class="function-syntax">CommandLine::declare_boolean_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">CRASHALL_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"crash-all"</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"intentionally crash on Problem messages, for backtracing"</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP6" class="function-link"><span class="function-syntax">CommandLine::declare_boolean_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">INDEX_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"index"</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"produce an Index"</span><span class="plain-syntax">, </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP6" class="function-link"><span class="function-syntax">CommandLine::declare_boolean_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">PROBLEMS_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"problems"</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"produce (an HTML) Problems report page"</span><span class="plain-syntax">, </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP6" class="function-link"><span class="function-syntax">CommandLine::declare_boolean_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">CENSUS_UPDATE_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"census-update"</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"withdrawn: previously, 'update the extensions census'"</span><span class="plain-syntax">, </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP6" class="function-link"><span class="function-syntax">CommandLine::declare_boolean_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">PROGRESS_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"progress"</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"display progress percentages"</span><span class="plain-syntax">, </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP6" class="function-link"><span class="function-syntax">CommandLine::declare_boolean_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">SIGILS_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"sigils"</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"print Problem message sigils"</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP6" class="function-link"><span class="function-syntax">CommandLine::declare_boolean_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">CHECK_RESOURCES_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"resource-checking"</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"check that figures, sounds and similar resources exist at compile-time"</span><span class="plain-syntax">, </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP6" class="function-link"><span class="function-syntax">CommandLine::declare_boolean_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">DIAGNOSTICS_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"diagnostics"</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"if no problems occur, write diagnostics files to directory X"</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP5" class="function-link"><span class="function-syntax">CommandLine::declare_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">REQUIRE_PROBLEM_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"require-problem"</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"return 0 unless exactly this Problem message is generated"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP5" class="function-link"><span class="function-syntax">CommandLine::declare_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">LOG_TO_PROJECT_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"log-to-project"</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"like -log X, but writing the debugging log into the project"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP5" class="function-link"><span class="function-syntax">CommandLine::declare_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">TEST_OUTPUT_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"test-output"</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"write output of internal tests to file X"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP6" class="function-link"><span class="function-syntax">CommandLine::declare_boolean_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">SILENCE_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"silence"</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"practice 'silence is golden': print only Unix-style errors"</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP6" class="function-link"><span class="function-syntax">CommandLine::declare_boolean_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">INBUILD_VERBOSE_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"inbuild-verbose"</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"equivalent to -inbuild-verbosity=1"</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP6" class="function-link"><span class="function-syntax">CommandLine::declare_numerical_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">INBUILD_VERBOSITY_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"inbuild-verbosity"</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">U</span><span class="string-syntax">"how much inbuild should explain: lowest is 0 (default), highest is 3"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/3-cla.html#SP5" class="function-link"><span class="function-syntax">CommandLine::end_group</span></a><span class="plain-syntax">();</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="1-mn.html#SP4">&#167;4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>Three of the five options here actually configure the <span class="extract"><span class="extract-syntax">problems</span></span> module
rather than <span class="extract"><span class="extract-syntax">core</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Main::switch</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">Main::switch</span></span>:<br/><a href="1-mn.html#SP4">&#167;4</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">id</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arg</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">state</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">id</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">CRASHALL_CLSW:</span><span class="plain-syntax"> </span><span class="identifier-syntax">debugger_mode</span><span class="plain-syntax"> = </span><span class="identifier-syntax">val</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><a href="../problems-module/2-pl0.html#SP5" class="function-link"><span class="function-syntax">ProblemSigils::crash_on_problems</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">INDEX_CLSW:</span>
<span class="plain-syntax">            </span><a href="../core-module/1-wtc.html#SP21" class="function-link"><span class="function-syntax">Task::disable_or_enable_index</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">?</span><span class="identifier-syntax">FALSE:TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="../core-module/1-wtc.html#SP21" class="function-link"><span class="function-syntax">Task::disable_or_enable_extensions_update</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">?</span><span class="identifier-syntax">FALSE:TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">index_explicitly_set</span><span class="plain-syntax"> = </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">PROBLEMS_CLSW:</span><span class="plain-syntax"> </span><a href="../core-module/1-wtc.html#SP21" class="function-link"><span class="function-syntax">Task::disable_or_enable_problems</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">?</span><span class="identifier-syntax">FALSE:TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">problems_explicitly_set</span><span class="plain-syntax"> = </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">CENSUS_UPDATE_CLSW:</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="constant-syntax">STDOUT</span><span class="plain-syntax">, </span><span class="string-syntax">"(ignoring -census-update and -no-census-update, "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"which have been withdrawn)\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">PROGRESS_CLSW:</span><span class="plain-syntax"> </span><a href="../core-module/1-pp2.html#SP1" class="function-link"><span class="function-syntax">ProgressBar::enable_or_disable</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">SIGILS_CLSW:</span><span class="plain-syntax"> </span><a href="../problems-module/2-pl0.html#SP4" class="function-link"><span class="function-syntax">ProblemSigils::echo_sigils</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">REQUIRE_PROBLEM_CLSW:</span><span class="plain-syntax"> </span><a href="../problems-module/2-pl0.html#SP3" class="function-link"><span class="function-syntax">ProblemSigils::require</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">arg</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">DIAGNOSTICS_CLSW:</span><span class="plain-syntax"> </span><span class="identifier-syntax">diagnostics_path</span><span class="plain-syntax"> = </span><a href="../foundation/3-pth.html#SP5" class="function-link"><span class="function-syntax">Pathnames::from_text</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">arg</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">CHECK_RESOURCES_CLSW:</span><span class="plain-syntax"> </span><a href="../multimedia-module/2-rf.html#SP1" class="function-link"><span class="function-syntax">ResourceFinder::set_mode</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">TEST_OUTPUT_CLSW:</span><span class="plain-syntax"> </span><a href="../core-module/1-itc.html#SP6" class="function-link"><span class="function-syntax">InternalTests::set_file</span></a><span class="plain-syntax">(</span><a href="../foundation/3-fln.html#SP3" class="function-link"><span class="function-syntax">Filenames::from_text</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">arg</span><span class="plain-syntax">)); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">LOG_TO_PROJECT_CLSW:</span><span class="plain-syntax"> </span><span class="identifier-syntax">log_to_project</span><span class="plain-syntax"> = </span><a href="../foundation/4-sm.html#SP3" class="function-link"><span class="function-syntax">Str::duplicate</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">arg</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">SILENCE_CLSW:</span><span class="plain-syntax"> </span><span class="identifier-syntax">silence_is_golden</span><span class="plain-syntax"> = </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">INBUILD_VERBOSE_CLSW:</span><span class="plain-syntax"> </span><a href="../supervisor-module/1-ic.html#SP2" class="function-link"><span class="function-syntax">Supervisor::set_verbosity</span></a><span class="plain-syntax">(1); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">INBUILD_VERBOSITY_CLSW:</span><span class="plain-syntax"> </span><a href="../supervisor-module/1-ic.html#SP2" class="function-link"><span class="function-syntax">Supervisor::set_verbosity</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><a href="../supervisor-module/1-ic.html#SP9" class="function-link"><span class="function-syntax">Supervisor::option</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">id</span><span class="plain-syntax">, </span><span class="identifier-syntax">val</span><span class="plain-syntax">, </span><span class="identifier-syntax">arg</span><span class="plain-syntax">, </span><span class="identifier-syntax">state</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Main::bareword</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">Main::bareword</span></span>:<br/><a href="1-mn.html#SP4">&#167;4</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">id</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">opt</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">state</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP23" class="function-link"><span class="function-syntax">Str::is_whitespace</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">opt</span><span class="plain-syntax">) == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP13" class="function-link"><span class="function-syntax">Str::get_last_char</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">opt</span><span class="plain-syntax">) == </span><span class="constant-syntax">FOLDER_SEPARATOR</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="../foundation/3-em.html#SP2" class="function-link"><span class="function-syntax">Errors::fatal_with_text</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">                </span><span class="string-syntax">"to compile a project in a directory, use '-project %S'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">opt</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">F</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP3" class="function-link"><span class="function-syntax">Filenames::from_text</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">opt</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../supervisor-module/1-ic.html#SP19" class="function-link"><span class="function-syntax">Supervisor::set_I7_source</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">F</span><span class="plain-syntax">) == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="../foundation/3-em.html#SP2" class="function-link"><span class="function-syntax">Errors::fatal_with_text</span></a><span class="plain-syntax">(</span><span class="string-syntax">"unknown command line argument: %S (see -help)"</span><span class="plain-syntax">, </span><span class="identifier-syntax">opt</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Main::silence_is_golden</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">Main::silence_is_golden</span></span>:<br/>Source Text - <a href="../supervisor-module/6-st.html#SP3">&#167;3</a><br/>Using Problems - <a href="../core-module/2-up2.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">silence_is_golden</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="M-pm.html">&#10094;</a></li><li class="progresschapter"><a href="M-cu.html">M</a></li><li class="progresscurrentchapter">1</li><li class="progresscurrent">mn</li><li class="progressnextoff">&#10095;</li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

